package com.spring.ioc;

import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan
public class BeanTest {
	public static void main(String[] args) {
		A a = new A();
		B b = new B();
		a.b = b;
		b.a = a;
	}

	@Test
	public void testGetBean() {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BeanTest.class);
		context.getBean(A.class);
	}
}
